package com.ruoyi.exam.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.exam.domain.PQuestionEquipmentBank;
import com.ruoyi.exam.mapper.PQuestionEquipmentBankMapper;
import com.ruoyi.exam.service.IPQuestionEquipmentBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备Service业务层处理
 *
 * @author ruoyi
 * @date 2021-12-28
 */
@Service
public class PQuestionEquipmentBankServiceImpl implements IPQuestionEquipmentBankService
{
    @Autowired
    private PQuestionEquipmentBankMapper pQuestionEquipmentBankMapper;

    /**
     * 查询设备
     *
     * @param id 设备主键
     * @return 设备
     */
    @Override
    public PQuestionEquipmentBank selectPQuestionEquipmentBankById(Long id)
    {
        return pQuestionEquipmentBankMapper.selectPQuestionEquipmentBankById(id);
    }

    /**
     * 查询设备列表
     *
     * @param pQuestionEquipmentBank 设备
     * @return 设备
     */
    @Override
    public List<PQuestionEquipmentBank> selectPQuestionEquipmentBankList(PQuestionEquipmentBank pQuestionEquipmentBank)
    {
        return pQuestionEquipmentBankMapper.selectPQuestionEquipmentBankList(pQuestionEquipmentBank);
    }

    /**
     * 新增设备
     *
     * @param pQuestionEquipmentBank 设备
     * @return 结果
     */
    @Override
    public int insertPQuestionEquipmentBank(PQuestionEquipmentBank pQuestionEquipmentBank)
    {
        pQuestionEquipmentBank.setCreateTime(DateUtils.getNowDate());
        return pQuestionEquipmentBankMapper.insertPQuestionEquipmentBank(pQuestionEquipmentBank);
    }

    /**
     * 修改设备
     *
     * @param pQuestionEquipmentBank 设备
     * @return 结果
     */
    @Override
    public int updatePQuestionEquipmentBank(PQuestionEquipmentBank pQuestionEquipmentBank)
    {
        pQuestionEquipmentBank.setUpdateTime(DateUtils.getNowDate());
        return pQuestionEquipmentBankMapper.updatePQuestionEquipmentBank(pQuestionEquipmentBank);
    }

    /**
     * 批量删除设备
     *
     * @param ids 需要删除的设备主键
     * @return 结果
     */
    @Override
    public int deletePQuestionEquipmentBankByIds(Long[] ids)
    {
        return pQuestionEquipmentBankMapper.deletePQuestionEquipmentBankByIds(ids);
    }

    /**
     * 删除设备信息
     *
     * @param id 设备主键
     * @return 结果
     */
    @Override
    public int deletePQuestionEquipmentBankById(Long id)
    {
        return pQuestionEquipmentBankMapper.deletePQuestionEquipmentBankById(id);
    }
}
